package com.guchenbo.example.sasl;

import java.security.Provider;
import java.security.Security;

public class SupportedSaslServerFactories {
    public static void main(String[] args) {
        // 获取所有已注册的 SaslServerFactory 提供者
        Provider[] providers = Security.getProviders();
        for (Provider provider : providers) {
            for (Provider.Service service : provider.getServices()) {
                if (service.getType().equals("SaslServerFactory")) {
                    String algorithm = service.getAlgorithm();
//                    SaslServerFactory factory = SaslServerFactory.getInstance(algorithm, null);
                    System.out.println("Provider: " + provider.getName());
                    System.out.println("Algorithm: " + algorithm);
//                    System.out.println("Server Factory: " + factory);
                    System.out.println();
                }
            }
        }
    }
}

